#ifndef YOOHOO_XMPPCORE_XMLWRITER_H
#define YOOHOO_XMPPCORE_XMLWRITER_H

#include "xmppcore/export.h"

#include <QtCore/QString>
#include <QtCore/QStack>

namespace yoohoo_xmppcore {

class YOOHOO_XMPPCORE_EXPORT XmlWriter {
public:
	XmlWriter();
	void writeAttribute(QString localName, QString value);
	void writeAttribute(QString prefix, QString localName, QString value);
	void writeCharacters(QString characters);
	void writeEndElement();
	void writeNamespace(QString namespaceUri);
	void writeStartElement(QString localName);
	void writeStartElement(QString prefix, QString localName);
	QString toXml();
	void writePrefix(QString prefix, QString namespaceUri);
	void writeEmptyElement(QString localName);
	void writeEmptyElement(QString prefix, QString localName);
	void writeCharacters(QString characters, bool escape);
	void clear();

protected:
	QString _xml;
	QStack<QString> _elements;
	bool _inStartElement;
};

}

#endif
